package es

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
)

var (
	Es *elasticsearch.Client
)

func ElasticSearch() {
	var err error
	cfg := elasticsearch.Config{
		Addresses: []string{
			"http://14.103.169.255:5601",
		},
		// ...
	}
	Es, err = elasticsearch.NewClient(cfg)
	if err != nil {
		fmt.Println("Es连接信息失败", err)
		return
	}
	fmt.Println("Es连接信息成功")
}
